import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Login from '../views/Login.vue'
import BlogM from '../views/BlogManager';
import PersonalBlog from '../views/PersonalBlog'
import UserManager from '../views/UserManager'
import NewBlog from '../views/NewBlog';
import BlogInfo from "../views/BlogInfo";
import Tag from "../views/Tag";
Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Login',
        component: Login
    }, {
        path: '/index',
        name: 'Index',
        component: Index,
        redirect: '/index/blogm',
        children: [{
                path: '/index/blogm',
                name: '所有博客',
                component: BlogM
            },

            {
                path: '/index/UserManager',
                name: '用户管理',
                component: UserManager
            },
            {
                path: '/personalBlog',
                name: '收藏管理',
                component: PersonalBlog
            },

            {
                path: '/index/tag',
                name: '标签管理',
                component: Tag
            }
        ]
    },
    {
        path: '/blogInfo',
        name: 'blogInfo',
        component: BlogInfo
    },
    {
        path: '/newBlog',
        name: 'newBlog',
        component: NewBlog
    },

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
